//
//  MarkBoatLocation.m
//  Regatta Mapping
//
//  Created by Asif on 8/9/12.
//  Copyright (c) 2012 TopOfStack Software. All rights reserved.
//

#import "MarkBoatLocation.h"

@implementation MarkBoatLocation
@synthesize name = _name;
@synthesize sourceID = _sourceID;
@synthesize coordinate = _coordinate;

- (id)initWithName:(NSString*)name sourceID:(NSString*)sourceID coordinate:(CLLocationCoordinate2D)coordinate
{
    if(self == [super init])
    {
        _name = [name copy];
        _sourceID = [sourceID copy];
        _coordinate = coordinate;
    }
    
    return self;
}

#pragma mark MKAnnotation Protocol methods

- (NSString *)title 
{
    if ([_name isKindOfClass:[NSNull class]]) 
        return @"Unknown charge";
    else
        return _name;
}

- (NSString *)subtitle 
{
    return _sourceID;
}

-(void) dealloc
{
    [_name release];
    [_sourceID release];
    [super dealloc];
}

@end
